package com.itheima.web.controller;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-14 15:21
 * @description
 */
public class MyExceptionHandler implements HandlerExceptionResolver {
    @Override
    public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {


        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("error/500");

        return modelAndView;
    }
}
